package com.baj.ldap.service;

import com.baj.ldap.entry.Person;
import com.baj.ldap.util.LdapResult;
import org.springframework.ldap.filter.Filter;

import java.util.List;

public interface PersonService {

    List<String> getDepartmentList(Filter filter);

    LdapResult create(Person person);

    LdapResult findOne(String key, String value);

    LdapResult findList(String key, String value);

    LdapResult findByCn(String cn);

    LdapResult modifyPerson(Person person);

    LdapResult deletePerson(Person person);


    /**
     * 查询全部
     *
     * @return {@link LdapResult}
     */
    LdapResult listAllPerson();

    /**
     * 保存
     *
     * @param person {@link Person}
     */
    LdapResult save(Person person);

    /**
     * 删除
     *
     * @param person {@link Person}
     */
    LdapResult delete(Person person);
}
